package day01;

import java.util.Arrays;
import java.util.Random;

public class Peach {
    public static void main(String[] args) {
        Random random = new Random();//随机数对象
        int[] num = new int[10];
        for (int i = 0; i < num.length; i++) {
            num[i] = random.nextInt(100);
            System.out.println(num[i]);
        }
        Arrays.sort(num);//升序
        int max = num[0]; // 第一最大
        System.out.println("排序后" + Arrays.toString(num));
        for (int i = 1; i < num.length; i++) {
            if (num[i] > max) {
                max = num[i];
            }
        }
        System.out.println(max);
    }
}
